package com.hp.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet("/DeleteByIdServlet")
public class DeleteByIdServlet extends HttpServlet {

	UserDao dao=new UserDao();
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
		}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String idStr=request.getParameter("id");
		int id=0;
		if (idStr !=null) {
			id=new Integer(idStr);
		}
		User ue=dao.deleteUserById(id);
		request.setAttribute("ue", ue);
	}

}
